﻿using Microsoft.TeamFoundation.WorkItemTracking.Client;

namespace WITD
{
    /// <summary>
    /// A class to help with displaying project information in a UI.
    /// </summary>
    public class ProjectType
    {
        /// <summary>
        /// The name of the project.
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// The work item types associated with the project.
        /// </summary>
        public WorkItemTypeCollection WitTypeCollection { get; set; }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="proj">The team project to query.</param>
        public ProjectType(Project proj)
        {
            this.Name = proj.Name;
            this.WitTypeCollection = proj.WorkItemTypes;
        }

        /// <summary>
        /// Returns the project name.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return this.Name;
        }
    }
}
